<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/echarts.js"></script>
	</head>
	<body>
		<!-- 为 ECharts 准备一个定义了宽高的 DOM -->
		<div id="main" style="width: 600px;height:400px;"></div>
		<script type="text/javascript">
			// 基于准备好的dom，初始化echarts实例
			let now = new Date();
			let hours = now.getHours();
			let theme = null;

			if (hours >= 19 || hours <= 6) {
				theme = 'dark';
			}

			var myChart = echarts.init(document.getElementById('main'), theme);

			// 指定图表的配置项和数据
			var option = 
			{
				title: {},
				tooltip: {},
				legend: {},

				series: 
				[
					{
						type: 'pie',
						data: [
							{
								value: 335,
								name: '1月'
							},
							{
								value: 1548,
								name: '2月'
							},
							{
								value: 335,
								name: '3月'
							},
							{
								value: 1548,
								name: '4月'
							},
							{
								value: 234,
								name: '5月'
							},
							{
								value: 335,
								name: '6月'
							},
							{
								value: 1548,
								name: '7月'
							},
							{
								value: 335,
								name: '8月'
							}
						],
						// radius: ['40%', '70%'],
						roseType: 'area'
					}
				],
			};

			// 使用刚指定的配置项和数据显示图表。
			myChart.setOption(option);
		</script>
	</body>
</html>